<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> <!--320-->
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="smooth_jquery-ui.css" />

<title>NoteItAll</title>

<script src="jquery/jquery-1.9.1.min.js"></script>
<script src="jquery/jquery.caret.js"></script>
<script src="jquery/jquery.nia-ac.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>

<?php 
include("dbconnect.php");

$rid = 0; 
$text = "";

if(isset($_GET["rid"])){
	$rid = $_GET["rid"]; 
	$q = "SELECT * FROM records WHERE rid ='". $rid."'";
	$result = mysql_query($q) or die('Query failed: ' . mysql_error());
	while($l = mysql_fetch_array($result, MYSQL_ASSOC)) {
		$text = $l['text'];
	}
}


?>

<script>
function formSubmit()
{
document.getElementById("note").submit();
}
</script>
</head>

<body>
<div id="locationTabs">
<ul>
<li><a href="index.php"><img src="./img/new.png" /></a></li>
<li><a href="search.php"><img src="./img/browse.png" /></a></li>
<li><a href="calendar.php"><img src="./img/calendar_top.png" /></a></li>
</ul>
</div><!-- locationTabs -->

	

<div id="secondaryControls">
<div onclick="$().addTagType('noteArea', '#');"><img src="./img/camera.png" alt="catigorie"/></div>
<div onclick="$().addTagType('noteArea', '#');"><img src="./img/mic.png" alt="catigorie"/></div>
<div onclick="formSubmit()"><img src="./img/save.png" alt="catigorie"/></div>
</div><!-- secondaryControls -->

<div id="noteBox">


	<form name="note" id="note" action="submitHandle.php" method="get">	
 		<textarea name="noteArea" id="noteArea" rows="5" cols="24"><?php echo $text; ?></textarea><br />
 		
 		
	<input type="hidden" name="rid" value="<?php echo $rid; ?>" />
	</form>


</div><!-- noteBox -->


<div class="buttons">
			<div onclick="$().addTagType('noteArea', '#');"><img src="./img/tag.png" alt="catigorie"/></div>
			<div onclick="$().addTagType('noteArea', '@');"><img src="./img/calendar.png" alt="date"/></div>
			<div onclick="$().addTagType('noteArea', '*');"><img src="./img/check.png" alt="to-do"/></div>
			<div onclick="$().addTagType('noteArea', '^');"><img src="./img/contact.png" alt="contact"/></div>
		</div><!-- buttons -->

</body>
</html>